package com.iwhalecloud.citybrain.flow.platform.manager.application.common.threadlocal;

import com.iwhalecloud.citybrain.flow.platform.manager.domain.model.User;

/**
　　* @description: 通用全局参数设置处理句柄
　　* @author shenrm
　　* @date 2021/11/11 14:46
　　*/
public class CommonGlobalParamSetHandle {

    /**
     * 存储全局的用户信息
     */
    static ThreadLocal<User> userInfoThreadLocal = new ThreadLocal<>();

    public static void setUser(User user) {
        userInfoThreadLocal.set(user);
    }

    public static User getUser() {
        return userInfoThreadLocal.get();
    }

    public static void remove() {
        userInfoThreadLocal.remove();
    }
}
